<template>
  <view class="page-container">
    <swiper class="truck-pictures" indicator-active-color="#fff" circular indicator-dots  v-if="messageTruck.pictureList">
      <swiper-item  v-for="(item,index) in messageTruck.pictureList" :key="index">
        <image class="picture" mode="aspectFill" :src="item.url"></image>
      </swiper-item>
    </swiper>
    <view class="truck-meta">
      <uni-list :border="false">
        <uni-list-item :border="false" title="车辆编号" :rightText="messageTruck.id" />
        <uni-list-item :border="false" title="车辆号牌" :rightText="messageTruck.licensePlate" />
        <uni-list-item :border="false" title="车型" :rightText="messageTruck.truckType" />
        <uni-list-item :border="false" title="所属机构" :rightText="messageTruck.currentOrganName" />
        <uni-list-item :border="false" title="载重" :rightText="messageTruck.allowableLoad" />
      </uni-list>
    </view>
  </view>
</template>

<script setup>
    import { getUsersTruck } from "@/pages/my/api";
    import { onLoad } from '@dcloudio/uni-app'
    import { ref } from 'vue'

    const messageTruck = ref({})
    onLoad(async ()=>{
      const res =  await getUsersTruck()  // 获取车辆信息请求
      messageTruck.value = res.data
    })
</script>

<style lang="scss" scoped>
  @import './index.scss';
</style>